<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 检测PHP环境
if(version_compare(PHP_VERSION,'5.4.0','<')) die('require PHP > 5.4.0 !');

$ip = '0.0.0.0';
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $arr    =   explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
    $pos    =   array_search('unknown',$arr);
    if(false !== $pos) unset($arr[$pos]);
    $ip     =   trim($arr[0]);
}elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
    $ip     =   $_SERVER['HTTP_CLIENT_IP'];
}elseif (isset($_SERVER['REMOTE_ADDR'])) {
    $ip     =   $_SERVER['REMOTE_ADDR'];
}

// 第一行为自定义允许的ip地址
$ipList = array('127.0.0.1', "60.186.192.234",
    "101.226.62.77","101.226.62.78","101.226.62.79","101.226.62.80","101.226.62.81","101.226.62.82",
    "101.226.62.83","101.226.62.84","101.226.62.85","101.226.62.86","101.226.103.59","101.226.103.60",
    "101.226.103.61","101.226.103.62","101.226.103.63","101.226.103.69","101.226.103.70","101.226.103.71",
    "101.226.103.72","101.226.103.73","140.207.54.73","140.207.54.74","140.207.54.75","140.207.54.76",
    "140.207.54.77","140.207.54.78","140.207.54.79","140.207.54.80","182.254.11.203","182.254.11.202",
    "182.254.11.201","182.254.11.200","182.254.11.199","182.254.11.198","59.37.97.100","59.37.97.101",
    "59.37.97.102","59.37.97.103","59.37.97.104","59.37.97.105","59.37.97.106","59.37.97.107","59.37.97.108",
    "59.37.97.109","59.37.97.110","59.37.97.111","59.37.97.112","59.37.97.113","59.37.97.114","59.37.97.115",
    "59.37.97.116","59.37.97.117","59.37.97.118","112.90.78.158","112.90.78.159","112.90.78.160","112.90.78.161",
    "112.90.78.162","112.90.78.163","112.90.78.164","112.90.78.165","112.90.78.166","112.90.78.167","140.207.54.19",
    "140.207.54.76","140.207.54.77","140.207.54.78","140.207.54.79","140.207.54.80","180.163.15.149","180.163.15.151",
    "180.163.15.152","180.163.15.153","180.163.15.154","180.163.15.155","180.163.15.156","180.163.15.157",
    "180.163.15.158","180.163.15.159","180.163.15.160","180.163.15.161","180.163.15.162","180.163.15.163",
    "180.163.15.164","180.163.15.165","180.163.15.166","180.163.15.167","180.163.15.168","180.163.15.169",
    "180.163.15.170","101.226.103.0/25","101.226.233.128/25","58.247.206.128/25","182.254.86.128/25",
    "103.7.30.21","103.7.30.64/26","58.251.80.32/27","183.3.234.32/27","121.51.130.64/27"
);

if(!in_array($ip, $ipList)){
    echo '<!DOCTYPE html>
		 <html>
		 <head>
		 <meta charset="UTF-8">
		 <title>平台维护中</title>
		 <meta name="viewport" content="initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		 <meta content="yes" name="apple-mobile-web-app-capable">
		 <meta content="red" name="apple-mobile-web-app-status-bar-style">
		 <meta name="format-detection" content="telphone=no">
		 <link rel="stylesheet" href="http://admin.xingyebao.com/css/mall.css">
		 </head>
		 <body>
		 <div style="position: absolute;left: 0;right: 0;bottom: 0;top: 50%;text-align: center;margin-top: -20px;">
		    <h1>平台升级维护中...</h1>
		    <div></div>
		 </div>
		 </body>
		 </html>';
    die;
}

/**
 * ThinkPHP 默认的调试模式配置文件
 */
defined('THINK_PATH') or exit();
// 调试模式下面默认设置 可以在应用配置目录下重新定义 debug.php 覆盖
return  array(
    'LOG_RECORD'            =>  true,  // 进行日志记录
    'LOG_EXCEPTION_RECORD'  =>  true,    // 是否记录异常信息日志
    'LOG_LEVEL'             =>  'EMERG,ALERT,CRIT,ERR,WARN,NOTIC,INFO,DEBUG,SQL',  // 允许记录的日志级别
    'DB_FIELDS_CACHE'       =>  false, // 字段缓存信息
    'DB_DEBUG'				=>  true, // 开启调试模式 记录SQL日志
    'TMPL_CACHE_ON'         =>  false,        // 是否开启模板编译缓存,设为false则每次都会重新编译
    'TMPL_STRIP_SPACE'      =>  false,       // 是否去除模板文件里面的html空格与换行
    'SHOW_ERROR_MSG'        =>  true,    // 显示错误信息
    'URL_CASE_INSENSITIVE'  =>  true,  // URL区分大小写
);